﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Yipusoft.Account.Model;
using Yipusoft.Account.BLL;
using Yipusoft.SoldierArchives.Model;
using Yipusoft.SoldierArchives.BLL;


public partial class Police_TranslateDocument_TransLateDepartment : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {

            DRDepartmentList.DataSource = GetDepartmentList();
            DRDepartmentList.DataTextField = "FullName";
            DRDepartmentList.DataValueField = "DepartmentID";
            DRDepartmentList.DataBind();
        }
    }

    public List<DepartmentInfo> GetDepartmentList()
    {

        List<DepartmentInfo> departmentList = new List<DepartmentInfo>();
        departmentList = Department.GetList("Right(DepartmentID,2)='00'");
        return departmentList;
    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        TranslateInfo translateInfo = Translate.GetDetail(new Guid(Request.QueryString["Fid"]));
        translateInfo.NewDepartment = DRDepartmentList.SelectedItem.Text;
        translateInfo.ToDepartmentID = DRDepartmentList.SelectedValue;
        Translate.Update(translateInfo);
        Response.Redirect("IntroduceLetterNew.aspx?Fid=" + Request.QueryString["Fid"]);
    }
}
